#include <iostream>
using namespace std;/* 命名空间*/

#include <queue>
#include <string.h>

#define BUFFER_SIZE 20


typedef struct Info
{
    int age;
    char name[BUFFER_SIZE];
}Info;

int main()
{
    #if 0
    queue<int> myqueue;
    myqueue.push(11);
    myqueue.push(22);
    myqueue.push(33);

    int len = myqueue.size();
    printf("len:%d\n", len);

    int frontVal = 0;
    while(!myqueue.empty())
    {
        frontVal = myqueue.front();
        printf("frontVal:%d\n", frontVal);

        myqueue.pop();
    }
    #else
    /* 复合数据类型*/
    Info stu1, stu2, stu3;

    /* 清楚脏数据*/
    memset(&stu1, 0, sizeof(stu1));
    memset(&stu2, 0, sizeof(stu2));
    memset(&stu3, 0, sizeof(stu3));

    stu1.age = 20;
    strncpy(stu1.name, "zhangsan", sizeof(stu1.name) - 1);

    stu2.age = 20;
    strncpy(stu2.name, "lisi", sizeof(stu2.name) - 1);

    stu3.age = 20;
    strncpy(stu3.name, "wangwu", sizeof(stu3.name) - 1);

    queue<Info> myqueue;
    /* 压栈*/
    myqueue.push(stu1);
    myqueue.push(stu2);
    myqueue.push(stu3);

    int len = myqueue.size();
    printf("len:%d\n", len);

    Info frontVal;
    memset(&frontVal, 0, sizeof(frontVal));

    while(!myqueue.empty())
    {
        frontVal = myqueue.front();
        printf("age:%d,\t name:%s\n", frontVal.age, frontVal.name);

        myqueue.pop();
    }


    #endif


    return 0;
}